﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace WindowsFormsApplication1
{
    public partial class Form2 : Form
    {
        private Form1 form1;
        public Form2(Form1 form1)
        {
            InitializeComponent();
            this.form1 = form1;
            printServerName.KeyPress += new KeyPressEventHandler(listenForEnter);
        }
        public void listenForEnter(object sender, KeyPressEventArgs e)
        {
            if (printServerName.Text != null)
            {
                if (e.KeyChar == (char)Keys.Enter)
                {
                    form1.setPrintServer(printServerName.Text);
                    this.Close();
                }
            }

        }
    }
}
